package com.example.springbott.bean.kerbal;

import com.example.springbott.bean.MarketCategory;
import com.example.springbott.bean.common.CommonData;
import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.util.List;
@Data
public class SpecCommonDate<T>  {
    /*limit: 20
   list: [{id: 1152101, goodsSn: "1152101", name: "魔兽世界 部落 奥格瑞玛 拉杆箱 可登机", categoryId: 1012001, brandId: 0,…},…]
   page: 6
   pages: 13
   total: 241*/
    private Integer total;
    private Integer pages;
    private Integer limit;
    private Integer page;
    private List<T> list;
    List<MarketCategory> filterCategoryList;


    public static SpecCommonDate data(PageInfo pageInfo) {
        SpecCommonDate data = new SpecCommonDate();
        data.setTotal((int) pageInfo.getTotal());
        data.setPages(pageInfo.getPages());
        data.setPage(pageInfo.getPageNum());
        data.setLimit(pageInfo.getPageSize());
        data.setList(pageInfo.getList());
        return data;
    }
}
